$(document).ready(function(){

	var pages = document.body.getAttribute("page");
	
	var page = pages.split(".");
	var current_page = SEPRO.admin;
	for(var i=0; i<page.length; i++){
		current_page = current_page[page[i]];
	}
	current_page.init();
});

var SEPRO = {};
SEPRO.admin = {};

SEPRO.admin.index = {
	
	init: function(){
		this.add_event_for_menu();
	},
	
	add_event_for_menu: function(){
		$("#left-menu-layer ul li a").mouseover(function(event){
			event.preventDefault();
			var index = $("#left-menu-layer ul li a").index($(this)[0]);
			var curLiEl = $("#left-menu-layer ul li").eq(index);
			var curImgEl = curLiEl.find("img");
			if(!curLiEl.hasClass("current")){
				curLiEl.addClass("hovered");
				curImgEl.attr("src", "/sepro/template/user/images/list-arrow-orange.gif");
			}
		});
		$("#left-menu-layer ul li a").mouseout(function(event){
			event.preventDefault();
			var index = $("#left-menu-layer ul li a").index($(this)[0]);
			var curLiEl = $("#left-menu-layer ul li").eq(index);
			var curImgEl = curLiEl.find("img");
			if(!curLiEl.hasClass("current")){
				curLiEl.removeClass("hovered");
				curImgEl.attr("src", "/sepro/template/user/images/list-arrow-gray.gif");
			}
		});
	}
}